﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WPFSamplesStudy
{
  /// <summary>
  /// Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
    }
    private static readonly Uri PackUri = new Uri("pack://application:,,,/");
    private void SampleGrid_Checked(object sender, RoutedEventArgs e)
    {
      if (e.Source is RadioButton)
      {
        var radioButton = (RadioButton)e.Source;
        var theFarme = (Frame)radioButton.Content;

        if (theFarme != null)
        {
          var source = theFarme.CurrentSource;
          if (source != null && !source.IsAbsoluteUri)
          {
            source = new Uri(PackUri, source);
          }

          SampleDisplayFrame.Source = source;
          SampleDisplayFrame.Visibility = Visibility.Visible;
        }
      }
    }

    private void SampleDisplayFrame_ContentRendered(object sender, EventArgs e)
    {

    }
  }
}